﻿using Max.PH4_2104A.Shopping.DTO;
using Max.PH4_2104A.Shopping.IService;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace Max.PH4_2104A.Shopping.API.Controllers.product
{
    /// <summary>
    /// 
    /// </summary>
    [Route("category")]
    [ApiController]
    public class CategoryController : ControllerBase
    {

        ICategoryService _service;
        /// <summary>
        /// 
        /// </summary>
        /// <param name="service"></param>
        public CategoryController(ICategoryService service)
        {
            _service = service;
        }



        /// <summary>
        /// 递归分类数据
        /// </summary>
        /// <returns></returns>
        [HttpGet("recurse")]
        public IActionResult Get()
        {
            ResponseResultDto response = new();

            var d = _service.GetRecurseCategory();

            response.Result = d;
            return Ok(response);
        }


    }
}
